package cn.bsuc.infirmary.domain;

import cn.bsuc.infirmary.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

@Getter@Setter
public class Drug extends Basedomain{

    //男
    public static final boolean GENDER_MAN =true;
    //女
    public static final boolean GENDER_WOMAN = false;
    private String name;

    private Systemdictionaryitem speci;

    private Systemdictionaryitem unit;

    private BigDecimal price;

    private boolean predrug=GENDER_MAN;

    private Date time;

    private String remark;
    public String getPredrug() {
        String temp = "未知";
        if (predrug == GENDER_MAN) {
            temp = "处方药";
        } else if (predrug == GENDER_WOMAN) {
            temp = "非处方药";
        }
        return temp;
    }
    public String getJson() {
        HashMap<String, Object> map = new HashMap<>();
        return JSONUtil.toJSONString(map);
    }
}